:root {
  --primary-color: #0a192f;
  --secondary-color: #112240;
  --accent-color: #64ffda;
  --text-color: #ccd6f6;
  --text-secondary: #8892b0;
  --success-color: #1cc88a;
  --warning-color: #f6c23e;
  --danger-color: #e74a3b;
  --card-bg: #112240;
  --border-color: #233554;
  --sidebar-width: 240px;
  --header-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--primary-color);
  color: var(--text-color);
  overflow-x: hidden;
}

.sidebar-section-title {
  display: block;
  color: var(--text-color);
  font-weight: 600;
  padding: 10px 20px;
  margin: 0;
}

.sidebar-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 10px 20px;
  border: none;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 15px;
  margin: 15px 0 5px;
  background-color: var(--secondary-color);
  border-radius: 4px;
  display: block;
}

/* 强制覆盖 Ant Design 卡片样式 */
.dark-theme-card.ant-card {
  background-color: var(--card-bg) !important;
  border-color: var(--border-color) !important;
}

.dark-theme-card .ant-card-head {
  background-color: var(--card-bg) !important;
  border-bottom-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

.dark-theme-card .ant-card-body {
  background-color: var(--card-bg) !important;
  color: var(--text-color) !important;
}

/* 表格样式覆盖 */
.dark-theme-card .ant-table {
  background-color: var(--card-bg) !important;
  color: var(--text-color) !important;
}

.dark-theme-card .ant-table-thead > tr > th {
  background-color: var(--secondary-color) !important;
  color: var(--text-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-header {
  background-color: var(--secondary-color);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.3s;
}

.menu-btn:hover {
  background: rgba(100, 255, 218, 0.1);
}

/* 菜单容器和下拉菜单样式 */
.menu-container {
  position: relative;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 180px;
  z-index: 1000;
  margin-top: 5px;
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--text-color);
  cursor: pointer;
  transition: background 0.2s;
  gap: 10px;
}

.menu-item:hover {
  background: rgba(100, 255, 218, 0.1);
}

.menu-item-icon {
  color: var(--accent-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #64ffda, #4e73df);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-badge {
  background: linear-gradient(90deg, #4e73df, #64ffda);
  color: var(--primary-color);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: bold;
}

.main-nav {
  display: flex;
  gap: 10px;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.nav-item:hover {
  color: var(--text-color);
  background: rgba(100, 255, 218, 0.05);
}

.nav-item.active {
  color: var(--text-color);
}

.nav-indicator {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-box {
  position: relative;
}

.search-box input {
  background: rgba(17, 34, 64, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 15px 8px 35px;
  color: var(--text-color);
  font-size: 14px;
  width: 250px;
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.notification-btn {
  background: none;
  border: none;
  color: var(--text-color);
  position: relative;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.3s;
}

.notification-btn:hover {
  background: rgba(100, 255, 218, 0.1);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger-color);
  color: white;
  font-size: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4e73df, #64ffda);
  display: flex;
  align-items: center;
  justify-content: center;
}

.username {
  font-size: 14px;
  font-weight: 500;
}

.main-content {
  display: flex;
  flex: 1;
  overflow: visible;
}

.sidebar {
  width: var(--sidebar-width);
  overflow-y: auto;
  height: 100%;
  background: var(--secondary-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 90;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(90deg, #64ffda, #4e73df);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-nav {
  padding: 15px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
  gap: 12px;
}

.sidebar-item:hover {
  background: rgba(100, 255, 218, 0.05);
  color: var(--text-color);
}

.sidebar-icon {
  font-size: 18px;
}

.sidebar-label {
  font-size: 14px;
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.connected {
  background: var(--success-color);
  box-shadow: 0 0 8px var(--success-color);
}

.status-dot.active {
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
}

.content-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  transition: margin-left 0.3s ease;
}

.content-area.with-sidebar {
  margin-left: 0;
}

.home-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.dashboard-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.dashboard-card h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.dashboard-card .value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 5px;
}

.dashboard-card .change {
  font-size: 14px;
  color: var(--success-color);
  display: flex;
  align-items: center;
  gap: 5px;
}

.change.negative {
  color: var(--danger-color);
}

.content-row {
  display: flex;
  gap: 20px;
}

.chart-container {
  flex: 1;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.chart-container h3 {
  margin-bottom: 15px;
  font-size: 16px;
  color: var(--text-color);
}

.data-section {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.data-section h3 {
  margin-bottom: 15px;
  font-size: 16px;
  color: var(--text-color);
}

.portfolio-section {
  flex: 1;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.portfolio-card {
  background: rgba(17, 34, 64, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  transition: transform 0.3s;
}

.portfolio-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
}

.portfolio-card h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.portfolio-value {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
}

.portfolio-change {
  font-size: 14px;
  font-weight: 500;
}

.portfolio-change.positive {
  color: var(--success-color);
}

.portfolio-change.negative {
  color: var(--danger-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-right .search-box {
    display: none;
  }
  
  .content-row {
    flex-direction: column;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

/* 添加缺失的样式 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(100, 255, 218, 0.3);
  border-radius: 50%;
  border-top-color: #64ffda;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.no-data {
  text-align: center;
  padding: 40px;
  color: #8892b0;
}

.data-table {
  overflow-x: auto;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background-color: #112240;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #233554;
}

.data-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #233554;
}

.data-table tr:hover {
  background-color: rgba(17, 34, 64, 0.5);
}

.dashboard-card .card-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.dashboard-card .value {
  font-size: 24px;
  font-weight: 700;
  margin: 5px 0;
}

.dashboard-card .change {
  font-size: 14px;
  font-weight: 500;
}

.dashboard-card .change.positive {
  color: #1cc88a;
}

.dashboard-card .change.negative {
  color: #e74a3b;
}

.page-container {
  padding: 20px;
}

.page-container h2 {
  margin-bottom: 20px;
  color: #ccd6f6;
}

/* 添加页面内容样式 */
.page-container {
  padding: 20px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.page-container h2 {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1.5rem;
}

.page-title {
  margin-bottom: 20px;
  color: var(--text-color);
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.page-content {
  padding: 15px;
}

.page-content h3 {
  margin-bottom: 15px;
  color: var(--accent-color);
}

.page-content p {
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
}

/* 数据下载页面样式 */
.download-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 15px 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  color: var(--text-color);
  font-weight: 500;
}

.form-control {
  background: rgba(17, 34, 64, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px 15px;
  color: var(--text-color);
  font-size: 14px;
  width: 100%;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.download-button {
  background: var(--accent-color);
  color: var(--primary-color);
  border: none;
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
  align-self: flex-start;
}

.download-button:hover {
  background: rgba(100, 255, 218, 0.8);
  transform: translateY(-2px);
}

.download-button:disabled {
  background: rgba(100, 255, 218, 0.3);
  cursor: not-allowed;
  transform: none;
}

.download-status {
  margin-top: 20px;
  padding: 15px;
  border-radius: 4px;
  font-size: 14px;
}

.status-loading {
  background: rgba(100, 255, 218, 0.1);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
}

.status-success {
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid #00c853;
  color: #00c853;
}

.status-error {
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid #ff5252;
  color: #ff5252;
}

.data-grid {
  margin-top: 20px;
  width: 100%;
  border-collapse: collapse;
}

.data-grid th, .data-grid td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-grid th {
  background: rgba(17, 34, 64, 0.8);
  color: var(--accent-color);
  font-weight: 500;
}

.data-grid tr:hover {
  background: rgba(17, 34, 64, 0.5);
}

.data-preview {
  margin-top: 30px;
}

.data-preview h3 {
  margin-bottom: 15px;
  font-size: 18px;
  color: var(--text-color);
}

.form-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}